package test3_10;

public class Test2_endToEndExchange {
    public static void main(String[] args) {
        /*
        首尾交换 {1,2,5,6,7,9} -> {9,7,6,5,2,1}
         */
        int[] array = {1, 2, 5, 6, 7, 9};
        int t = 0;
        for (int i = 0; i < array.length / 2; i++) {
            t = array[i];
            array[i] = array[array.length - i - 1];
            array[array.length - i - 1] = t;
        }

        for (int x : array) {
            System.out.print(x + " ");
        }
    }
}
